﻿using Rsd.Dudu;
using Rsd.Dudu.BizModel;
using Rsd.Dudu.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rsd.Faith.Core 
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public abstract class BizService<T>: Rsd.Dudu.Core.BaseService, IBizService<T> where T:IOperation,new()
    {
        public int Delete(T obj,DeleteType type = DeleteType.Logic)
        {
            var myType = MyType.GetType<T>();
            myType.DeleteObject(obj, type);
            return 0;
        }

        public int Save(T obj)
        {
            var myType = MyType.GetType<T>();
            myType.SaveObjects(obj);
            return 0;
        }
    }
}
